// let str: string | number = 100

//定义枚举类型
// enum Direction {
//   front = 1,
//   back = 2,
//   left = 3,
//   right = 4
// }

enum Direction { front = 1, back = 4, left = 7, right = 9 }

// console.log(Direction.front)
console.log(Direction.right)

//定义联合类型
// type Direction = 1 | 2 | 3 | 4

function handleTurn(direct: Direction) {

}



// handleTurn(Direction.back)
// handleTurn(5)   //报错：类型“5”的参数不能赋给类型“Direction”的参数